home *** CD-ROM | disk | FTP | other *** search
- > I'm having some trouble with AMOS and the manual doesn't seem to
- > explain this. Basically, I'm trying to write program code like this:
- >
- > IF blah=blah
- > blah
- > blah
- > IF blah=blah
- > blah
- > GOSUB blah
- > GOTO blah
- > ENDIF
- > IF blah=blah
- > blah
- > GOSUB blah
- > GOTO blah
- > ENDIF
- > ENDIF
- >
- > I've put the relevant stuff in capitals to make it easier to read.
- > I have a lot of structures like or similar to this. AMOS, unfortunately,
- > doesn't seem to like having IF THEN ENDIF statements inside of other IF
- > THEN ENDIF's. This is a pretty big problem because I really need to be
- > able to use this kind of logic. When I try to run it (or just plain test it, it
- > tests before it runs), it'll tell me that I need a THEN statement after the
- > IF. If I put that THEN statement in there, it tells me that I don't need an
- > ENDIF since there's no IF! Apparently if you try
- >
- > IF blah=blah THEN
- > etc.
- > IF blah=blah THEN
- > etc.
- > ENDIF
- > ENDIF
- >
- > it thinks that the first line is self-contained in the sense that the second
- > line, etc, is not inside the IF THEN statement started in the first line. If I
- > do this
- >
- > SUB1:
- > IF blah=blah
- > gosub SUB2
- > ENDIF
- > GOTO blah
- > SUB2:
- > IF blah=blah
- > blah
- > ENDIF
- > RETURN
- >
- > it doesn't give me errors. Doing this, though, is a real pain and makes it
- > harder to follow what's going on (especially if you have four or five
- > nested IF THEN ENDIF's for example). Can anyone suggest something?
- > How can I get it to stop doing this? Please help! Thanks in advance,
- >
- >
- >
- > Andrew
- >
-
- You have to use the THEN statement when embedding conditionals ie
-
- If A=B
- If b=c Then c=d Endif
- Endif
-
- -Jedon
-
-
-
-